#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N_MAX ((int)1e+3)
#define M_MAX ((int)5e+5)
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) > (y) ? (x) : (y))
#define SWAP_INT(a, b) ((a)^(b) ? (b)^=(a), (a)^=(b), (b)^=(a) : )

struct Node {
	int x;
	Node *next;
};

struct adjlist {
	Node *first;
	Node *last;
	int size;
};

void
init(struct adjlist *adjList)
{
	adjList->size = 0;
	adjList->first = adjList->last = NULL;
}

void
pushback(struct adjlist *al, int x)
{
	struct Node *newnode;

	newnode = (struct Node *) malloc(sizeof(Node));
	newnode->x = x;
	newnode->next = NULL;
	if (!al->first)
		al->first = newnode;
	else
		al->last->next = newnode;
	al->last = newnode;
	al->size++;
}

void
free_al(struct adjlist *al)
{
	struct Node *n, *p;
	p = n = al->first;
	while (n) {
		n = n->next;
		free(p);
		p = n;
	}
}

void
listprint(struct Node *node)
{
	while (node) {
		printf("%d%s", node->x + 1, node->next ? " " : "\n");
		node = node->next;
	}
}

int
main(void)
{
	static struct adjlist al[N_MAX];
	static short int edges[M_MAX][2];
	int n, m;
	register int i = 0, j = 0;
	int a = 0, b = 0;
	static unsigned char r[N_MAX];
	Node *nd = NULL;
	int loops_n_multpl_edgs = 0;

	scanf("%d%d", &n, &m);

	for (i = 0 ; i < n ; i++)
		init(&al[i]);

	for (j = 0 ; j < m ; j++) {
		scanf("%d%d", &a, &b);
		a--; b--;

		if (a == b)
			loops_n_multpl_edgs++;
		pushback(&al[a], b);
		pushback(&al[b], a);
	}

	printf("%d\n", n * (n - 1) / 2 - m + loops_n_multpl_edgs);
	for (i = j = 0 ; i < n ; i++) {
		nd = al[i].first;
		memset(r, 1U, sizeof r);
		for (j = 0 ; j < al[i].size && nd ; j++, nd = nd->next)
			r[nd->x] = 0U;

		for (j = 0 ; j < n ; j++)
			if (r[j] && i != j) {
				printf("%d %d\n", i+1, j+1);
				pushback(&al[MAX(i, j)], MIN(i, j));
			}
	}

	for (j = 0 ; j < n ; j++)
		free_al(&al[j]);

	return 0;
}
